﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeBehind="NivdalSchedule.aspx.cs" Inherits="Nivdal.NivdalSchedule" Theme="SkinFile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="GlobalScheduleLabel" runat="server" Text="Global schedule: " CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:GridView ID="GlobalScheduleGridview" runat="server" DataSourceID="GlobalScheduleDataSourse"
         SkinID="Professional" AllowPaging="false" AutoGenerateColumns="false">
        <Columns>
            <asp:TemplateField HeaderText="Routine name">
                <ItemTemplate>
                    <asp:Label ID="RoutineNameLabel" runat="server" Text='<%# Eval("Name") %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Last Execution Time">
                <ItemTemplate>
                    <asp:Label ID="LastExecutionTimeLabel" runat="server" Text='<%# Eval("LastExecutionTime") %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Next Execution Time">
                <ItemTemplate>
                    <asp:Label ID="NextExecutionTimeLabel" runat="server" Text='<%# Eval("NextExecutionTime") %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        </asp:GridView> 
        <br />
        <asp:Repeater ID="CountriesRepeater" runat="server" DataSourceID="CountriesListDataSource">
        <ItemTemplate>
            <asp:HiddenField ID="CountryIdHiddenField" runat="server" Value='<%# Eval("Id") %>' />
            <asp:Label ID="TableTitleLabel" runat="server" Text='<%# "Schedule in " + Eval("Name") %>' SkinID="InfoLabel"></asp:Label>
            <br />
            <asp:GridView ID="LocalScheduleGridview" runat="server" DataSourceID="LocalScheduleDataSource" SkinID="Professional"
             AutoGenerateColumns="false" AllowPaging="false">
                <Columns>
                    <asp:TemplateField HeaderText="Routine name">
                        <ItemTemplate>
                            <asp:Label ID="RoutineNameLabel" runat="server" Text='<%# Eval("Name") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Last Execution Time">
                        <ItemTemplate>
                            <asp:Label ID="LastExecutionTimeLabel" runat="server" Text='<%# Eval("LastExecutionTime") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Next Execution Time">
                        <ItemTemplate>
                            <asp:Label ID="NextExecutionTimeLabel" runat="server" Text='<%# Eval("NextExecutionTime") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <asp:SqlDataSource ID="LocalScheduleDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
             SelectCommand="Nivdal_GetCountrySchedule" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="CountryIdHiddenField" PropertyName="Value" Type="Decimal" Name="CountryId" />
                </SelectParameters>
            </asp:SqlDataSource>
        </ItemTemplate>
    
        </asp:Repeater>


         <asp:SqlDataSource ID="GlobalScheduleDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetGlobalSchedule" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
         <asp:SqlDataSource ID="CountriesListDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetListOfCountryIds" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="Site admin >> Schedule details" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
